package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderStatisticsVO;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrdersMapper {
    @Select("select * from orders where id = #{id}")
    Orders getById(Long id);


    public Page<OrderVO> orderPageQuery(OrdersPageQueryDTO dto);

    void cancelOrder(Orders orders);
   @Select("SELECT COUNT(*) as toBeConfirmed FROM `orders` WHERE `status` = 2")
    Integer toBeConfirmed();
    @Select("SELECT COUNT(*) as confirmed FROM `orders` WHERE `status` = 3")
    Integer confirmed();
    @Select("SELECT COUNT(*) as deliveryInProgress FROM `orders` WHERE `status` = 4")
    Integer deliveryInProgress();

    void complete(Orders build);

    void rejection(Orders orders);
}
